// Copyright 2007 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package lichen.services.menu.impl;

import lichen.services.menu.Menu;

/**
 * 默认的menu类.
 * @author jcai
 * @version $Revision: 7 $
 * @since 0.0.2
 */
public class MenuImpl implements Menu {

	private String linkType;
	private Object [] linkContext;
	private String pagePath;
	private String pageText;
	private boolean _disabled;
	/**
	 * @return Returns the linkContext.
	 */
	public Object[] getPageContext() {
		return linkContext;
	}
	/**
	 * @param linkContext The linkContext to set.
	 */
	public void setPageContext(Object... linkContext) {
		this.linkContext = linkContext;
	}
	/**
	 * @return Returns the linkType.
	 */
	public String getLinkType() {
		return linkType;
	}
	/**
	 * @param linkType The linkType to set.
	 */
	public void setLinkType(String linkType) {
		this.linkType = linkType;
	}
	/**
	 * @return Returns the pageName.
	 */
	public String getPagePath() {
		return pagePath;
	}
	/**
	 * @param pageName The pageName to set.
	 */
	public void setPagePath(String pageName) {
		this.pagePath = pageName;
	}
	/**
	 * @return Returns the pagePath.
	 */
	public String getPageText() {
		return pageText;
	}
	/**
	 * @param pageText The pagePath to set.
	 */
	public void setPageText(String pageText) {
		this.pageText = pageText;
	}
	public boolean isDisabled(){
		return _disabled;
	}
	public void setDisabled(boolean disabled){
		this._disabled = disabled;
	}
	public static Menu newInstance(String string) {
		MenuImpl menu = new MenuImpl();
		menu.setDisabled(true);
		menu.setPageText(string);
		return menu;
	}
}
